{php include wl_template('common/header');}
<ul class="nav nav-tabs">
    <li class="active"><a href="javascript:;">名片管理</a></li>
</ul>
<div class="app-content">
    <!--  信息筛选  -->
    <div class="app-filter">
        <div class="filter-list">
            <form class="form-horizontal" action="{php echo web_url('cashback/cashback/cashBackRecord',['status'=>$_GPC['status'],'plugin'=>$_GPC['plugin']])}" method="post">
                <div class="form-group">
                    <label class="col-sm-2 control-label">状态</label>
                    <div class="col-sm-9">
                        <div class="btn-group">
                            <a href="{php echo web_url('cashback/cashback/cashBackRecord',['status'=>'','plugin'=>$_GPC['plugin']])}"
                               class="btn {if empty($_GPC['status'])}btn-primary{else}btn-default{/if}">全部</a>
                            <a href="{php echo web_url('cashback/cashback/cashBackRecord',['status'=>1,'plugin'=>$_GPC['plugin']])}"
                               class="btn {if $_GPC['status'] == 1}btn-primary{else}btn-default{/if}">已返现</a>
                            <a href="{php echo web_url('cashback/cashback/cashBackRecord',['status'=>'zero','plugin'=>$_GPC['plugin']])}"
                               class="btn {if $_GPC['status'] == 'zero'}btn-primary{else}btn-default{/if}">待审核</a>
                            <a href="{php echo web_url('cashback/cashback/cashBackRecord',['status'=>2,'plugin'=>$_GPC['plugin']])}"
                               class="btn {if $_GPC['status'] == 2}btn-primary{else}btn-default{/if}">未通过</a>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">订单类型</label>
                    <div class="col-sm-9">
                        <div class="btn-group">
                            <a href="{php echo web_url('cashback/cashback/cashBackRecord',['status'=>$_GPC['status'],'plugin'=>''])}"
                               class="btn {if empty($_GPC['plugin'])}btn-primary{else}btn-default{/if}">全部</a>
                            <a href="{php echo web_url('cashback/cashback/cashBackRecord',['status'=>$_GPC['status'],'plugin'=>'rush'])}"
                               class="btn {if $_GPC['plugin'] == 'rush'}btn-primary{else}btn-default{/if}">抢购</a>
                            <a href="{php echo web_url('cashback/cashback/cashBackRecord',['status'=>$_GPC['status'],'plugin'=>'groupon'])}"
                               class="btn {if $_GPC['plugin'] == 'groupon'}btn-primary{else}btn-default{/if}">团购</a>
                        </div>
                    </div>
                </div>
                <div class="form-group form-inline">
                    <label class="col-sm-2 control-label">记录搜索</label>
                    <div class="col-sm-9">
                        <select name="search_type" class="form-control">
                            <option value="0" {if $searchType == 0}selected{/if}>全部</option>
                            <option value="1" {if $searchType == 1}selected{/if}>商品id</option>
                            <option value="2" {if $searchType == 2}selected{/if}>买家ID</option>
                            <option value="3" {if $searchType == 3}selected{/if}>买家昵称</option>
                        </select>
                        <input type="text" name="search" class="form-control" value="{$search}" placeholder="请输入关键字">
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-2 control-label"></div>
                    <div class="col-sm-9">
                        <button class="btn btn-primary" type="submit">搜索</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
    <!--  信息列表  -->
    <div class="app-table-list">
        {if !empty($list)}
            <!--列表信息-->
            <div class="table-responsive">
                <table class="table table-hover table-bordered">
                    <thead>
                        <tr>
                            <th class="text-center" width="5%"><input type="checkbox" /></th>
                            <th class="text-center" width="10%">所属用户</th>
                            <th class="text-center" width="10%">商品类型</th>
                            <th class="text-center" width="15%">商品名称</th>
                            <th class="text-center" width="10%">支付金额</th>
                            <th class="text-center" width="10%">返现金额</th>
                            <th class="text-center" width="15%">订单号</th>
                            <th class="text-center" width="10%">状态</th>
                            <th class="text-center" width="15%">操作</th>
                        </tr>
                    </thead>
                    <tbody>
                    {loop $list $val}
                        <tr class="text-center">
                            <td>
                                {if $val['status'] != 1}
                                    <input type="checkbox" value="{$val['id']}" />
                                {/if}
                            </td>
                            <td class="text-left">
                                <img src="{$val['avatar']}" style="width: 50px;height: 50px;">
                                <span style="margin-left: 5px;">{$val['nickname']}</span>
                            </td>
                            <td>
                                {if $val['plugin'] == 'rush'}
                                    <label class="label label-primary">抢购</label>
                                {elseif $val['plugin'] == 'groupon'}
                                    <label class="label label-info">团购</label>
                                {/if}
                            </td>
                            <td>{$val['goods_name']}</td>
                            <td>
                                <label class="label label-success">￥{$val['price']}</label>
                            </td>
                            <td>
                                <label class="label label-success">￥{$val['money']}</label>
                            </td>
                            <td>{$val['order_no']}</td>
                            <td>
                                {if $val['status'] == 0}
                                    <label class="label label-warning">审核中</label>
                                {elseif $val['status'] == 1}
                                    <label class="label label-success">已返现</label>
                                {elseif $val['status'] == 2}
                                    <label class="label label-danger">未通过</label>
                                {/if}
                            </td>
                            <td>
                                {if $val['status'] == 0}
                                    <a href="{php echo web_url('cashback/cashback/cashBackToExamine',['id'=>$val['id'],'status'=>1])}" data-toggle="ajaxPost" class="btn btn-info btn-sm">通过</a>
                                    <a href="{php echo web_url('cashback/cashback/cashBackToExamine',['id'=>$val['id'],'status'=>2])}" data-toggle="ajaxPost" class="btn btn-sm btn-danger">不通过</a>
                                {elseif $val['status'] == 1}

                                {elseif $val['status'] == 2}
                                    <a href="{php echo web_url('cashback/cashback/cashBackToExamine',['id'=>$val['id'],'status'=>0])}" data-toggle="ajaxPost" class="btn btn-warning btn-sm">重新审核</a>
                                {/if}
                            </td>
                        </tr>
                    {/loop}
                    </tbody>
                </table>
            </div>
            <!--批量操作-->
            <div class="app-table-foot clearfix">
                <div class="pull-left">
                    <button data-href="{php echo web_url('cashback/cashback/cashBackToExamine',['id'=>$val['id'],'status'=>1])}" data-confirm="确定通过当前选择的名片？"  class="btn btn-default" type="button" data-toggle='batch'>通过</button>
                    <button data-href="{php echo web_url('cashback/cashback/cashBackToExamine',['id'=>$val['id'],'status'=>2])}" data-confirm="确定不通过当前选择的名片？"  class="btn btn-default" type="button" data-toggle='batch'>不通过</button>
                    <button data-href="{php echo web_url('cashback/cashback/cashBackToExamine',['id'=>$val['id'],'status'=>0])}" data-confirm="确定重新审核当前选择的名片？"  class="btn btn-default" type="button" data-toggle='batch'>重新审核</button>
                </div>
                <div class="pull-right">
                    {$pager}
                </div>
            </div>
        {else}
            <div class="no-result">
                <p>还没有相关数据</p>
            </div>
        {/if}
    </div>
</div>
{php include wl_template('common/footer');}